﻿@model WaiGaoQiaoWeb.Models.TwoCanteenSummaryReportDetailVM
@{
    ViewBag.Title = "TwoCanteenSummaryReportDetailIndex";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@section Head
{
    @Html.Css("dp")
    @Html.Js("datepicker")
    <script type="text/javascript">
        var mainheight = document.documentElement.clientHeight;
        var mainWidth = document.documentElement.clientWidth;
        $(document).ready(function () {
            var otherpm = $("#title").height() + $("#findDiv").height(); // 290;
            var gh = mainheight - otherpm - 60;
            var option = {
                height: gh,
                width: mainWidth,
                url: '@Url.Action("GetList")',
                colModel: [
                    { display: 'MenuId', name: 'MenuId', width: 60, sortable: false, align: 'left', hide: true, iskey: true },
                    { display: '菜单名称', width: 80, sortable: false, hide: false, align: 'left' },
                    { display: '份数', width: 60, sortable: false, hide: false, align: 'left' },
			        { display: '总金额', width: 60, sortable: false, hide: false, align: 'left' }
				],
                singleselected: true,
                sortname: "Sequence",
                sortorder: "asc",
                title: false,
                usepager: true,
                page: 1,
                rp: 20,
                rpOptions: [10, 15, 20],
                showcheckbox: true,
                rowbinddata: true,
                //query: $("#StartTime").val() + "," + $("#EndTime").val() + "," + $("#PNAME").val()
                query: $("#StartTime").val() + "," + $("#EndTime").val()
            };
            $("#FundsOperatingList").flexigrid(option);

            $("#btnQueryList").click(function () {
                //option.query = $("#StartTime").val() + "," + $("#EndTime").val() + "," + $("#PNAME").val();
                option.query = $("#StartTime").val() + "," + $("#EndTime").val();
                option.newp = 0;
                $("#FundsOperatingList").flexOptions(option).flexReload();
            });
            $("#btnExport").click(function () {
                var vstarttime = $("#StartTime").val();
                var vendtime = $("#EndTime").val();
                //var vpname = $("#PNAME").val();
                //var strulr = "ReportOut?StartTime=" + vstarttime + "&EndTime=" + vendtime + "&PNAME=" + vpname;
                var strulr = "ReportOut?StartTime=" + vstarttime + "&EndTime=" + vendtime;
                var subwin = window.open(strulr, "", "menubar=no,toolbar=no,status=no,resizable=no,scrollbars=yes");
                subwin.moveTo(0, 0);
                subwin.resizeTo(window.screen.availWidth, window.screen.availHeight);
                return false;
            });
        });
    </script>
}
<div id="container">
    <div id="mainContent">
        <div id="title" class="title">
            二食堂详细统计表</div>
        <div id="findDiv">
            <table>
                <tr>
                    <td style="text-align: right; width: 80px;">
                        开始日期：
                    </td>
                    <td>
                        @Html.TextBox("StartTime", DateTime.Now.Date.ToString("yyyy-MM-dd") + " 00:00", new { @ReadOnly = true, @style = "width:140px;", onfocus = "WdatePicker({vel:'C1SignInTime.BeginTime',dateFmt:'yyyy-MM-dd HH:mm'})" })
                    </td>
                    <td style="text-align: right; width: 80px;">
                        结束日期：
                    </td>
                    <td>
                        @Html.TextBox("EndTime", DateTime.Now.Date.ToString("yyyy-MM-dd") + " 23:59", new { @ReadOnly = true, @style = "width:140px;", onfocus = "WdatePicker({vel:'C1SignInTime.BeginTime',dateFmt:'yyyy-MM-dd HH:mm'})" })
                    </td>
                    @*<td style="text-align: right; width: 80px;">
                        姓名：
                    </td>
                    <td>
                        @Html.TextBoxFor(model => model.PNAME, new { @style = "width:140px;" })
                    </td>*@
                    <td>
                        <a id="btnQueryList" class="button" href="javascript:void(0);"><span>查 询</span></a>
                        <a id="btnExport" class="button" href="javascript:void(0);"><span>导 出</span></a>
                    </td>
                </tr>
            </table>
        </div>
        <table id="FundsOperatingList" style="display: none;">
        </table>
    </div>
</div>
